package com.xh.bussiness.course.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.xh.bussiness.course.bean.request.CourseChapterRequest;
import com.xh.bussiness.course.model.CourseChapter;
import com.xh.bussiness.resource.bean.dto.MaterialDto;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

public interface CourseChapterMapper extends BaseMapper<CourseChapter> {
    List<CourseChapter> queryAll(@Param("bean") CourseChapterRequest request);

    List<Map<String, Object>> queryMaterialCountByType(@Param("userId")String userId,@Param("courseIndexId") String courseIndexId);

    List<MaterialDto> queryMaterialByCourseIndex(@Param("userId")String userId,@Param("courseIndexId") String courseIndexId, @Param("type") Integer type);

    boolean deleteByCourseIndexId(@Param("courseIndexId") String courseIndexId,@Param("chapterId") String chapterId);
}
